home *** CD-ROM | disk | FTP | other *** search
- Path: bga.com!news
- From: makuch@bga.com (Michael Makuch)
- Newsgroups: comp.lang.c,comp.os.ms-windows.nt.misc,comp.programming,comp.std.c,comp.unix.aix
- Subject: Re: function pointers
- Date: 31 Jan 1996 19:56:11 GMT
- Organization: Real/Time Communications - Bob Gustwick and Associates
- Message-ID: <4eohgr$gt0@giga.bga.com>
- References: <4eogio$gt0@giga.bga.com>
- Mime-Version: 1.0
- X-RTcode: 2e38723c315b7bb02e0fc90e
- X-Newsreader: WinVN 0.99.4
-
- In article <4eogio$gt0@giga.bga.com>, makuch@bga.com says...
- >
- >The following c code segment compiles and works on
- >NT MSVC++ and on SVR4 C compiler, but errors out
- >on AIX with a type mismatch;
- >
- >struct foostruct1 * myfoo1();
- >struct foostruct2 * myfoo2();
- >void *(*ptr)();
- >
- >ptr = myfoo1;
- >[snip]
- >ptr = myfoo2;
- >
- >I'm passing the function pointer ptr, to a function
- >which then calls myfoo1, myfoo2, etc., etc. I can think
- >of several work arounds but I'd rather get the AIX
- >compiler to accept it. Is there a portable solution to
- >get the AIX compiler to accept it? Casting the assignment
- >as
- >
- >prt = (struct foostruct1 *)myfoo1;
- >
- >doesn't work either.
- >
- >Thanx for any clues.
- >mkm@abm.austin.tx.us
- >
-
- Oops. What I meant to say at the end there was that
-
- prt = (void *)myfoo1();
-
- doesn't work either.
-
- Thanx.
- mkm@abm.austin.tx.us
-
-